﻿using Cms.Domain.Authentication;
using Cms.Web.Framework.Infrastructure.Wrappers;
using Moq;

namespace Cms.Tests.Unit.WebFramework.Infrastructure
{
    public class InfrastructureTestsHelper
    {
        public static ICmsIdentity GetIdentity(int id)
        {
            Mock<ICmsIdentity> identityMock = new Mock<ICmsIdentity>();
            AuthenticatedUser user = new AuthenticatedUser { AdministratorID = id };
            string compressedUser = Conversion.ToCompressedString(user);
            identityMock.SetupGet(m => m.Name).Returns(compressedUser);
            return identityMock.Object;
        }
    }
}
